Skip to content

Support monorepo ts parser v2#85

Merged
angrychow merged 15 commits intocloudwego:mainfrom
yewanting:feat-ts-monorepo-support-v2
Sep 30, 2025
Merged

Support monorepo ts parser v2#85
angrychow merged 15 commits intocloudwego:mainfrom
yewanting:feat-ts-monorepo-support-v2

Conversation

@yewanting
Copy link
Copy Markdown
Contributor

What type of PR is this?

feat: support monorepo ts parser

Detailed description for this PR

1.Use Cases
  • Combined mode (default) : Suitable for scenarios that require overall analysis of monorepo structure
  • Separate mode : Suitable for scenarios that require independent analysis of each package, facilitating package-level code analysis and processing
2. Usage
  • Use combined mode (default) : node dist/index.js parse /path/to/monorepo
  • Use separate mode : node dist/index.js parse /path/to/monorepo --monorepo-mode separate

这个 PR 的作用

feat:支持 monorepo 的 ts 解析

这个 PR 的详细描述

1. 使用场景
  • Combined 模式(默认) :适用于需要整体分析 monorepo 结构的场景
  • Separate 模式 :适用于需要独立分析每个包的场景,便于包级别的代码分析和处理
2. 使用方式
  • 使用 combined 模式(默认):node dist/index.js parse /path/to/monorepo
  • 使用 separate 模式 :node dist/index.js parse /path/to/monorepo --monorepo-mode separate

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 11, 2025

CLA assistant check
All committers have signed the CLA.

@welkeyever
Copy link
Copy Markdown
Member

Related to #75

Comment thread ts-parser/src/parser/RepositoryParser.ts
Comment thread ts-parser/src/parser/RepositoryParser.ts
@angrychow angrychow self-requested a review September 14, 2025 02:30
@angrychow angrychow self-assigned this Sep 14, 2025
Copy link
Copy Markdown
Collaborator

@angrychow angrychow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you offer a runnable unit test case in src/utils/test for this feature? And I think we could start some worker threads to parse these packages in separated mode.

@yewanting
Copy link
Copy Markdown
Contributor Author

Would you offer a runnable unit test case in src/utils/test for this feature? And I think we could start some worker threads to parse these packages in separated mode.

yep, I will offer the unit test case .
good suggestion! I will optimize it and start some worker threads in separated mode.

@GuangmingLuo
Copy link
Copy Markdown
Member

image

@angrychow angrychow requested a review from anup-a September 25, 2025 13:15
Comment thread ts-parser/src/parser/test/VarParser.test.ts Outdated
@angrychow
Copy link
Copy Markdown
Collaborator

angrychow commented Sep 27, 2025

I have reviewed these changes and seems that it not affect single repo parsing.

@yewanting yewanting changed the title [WIP] Support monorepo ts parser v2 Support monorepo ts parser v2 Sep 29, 2025
Comment thread ts-parser/src/parser/RepositoryParser.ts
Comment thread ts-parser/src/parser/RepositoryParser.ts
Comment thread ts-parser/src/parser/RepositoryParser.ts Outdated
Comment thread ts-parser/src/utils/cluster-processor.ts
@angrychow angrychow self-requested a review September 30, 2025 12:53
Copy link
Copy Markdown
Collaborator

@angrychow angrychow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have reviewed and tested, no problem.

@angrychow angrychow merged commit 51ef61c into cloudwego:main Sep 30, 2025
3 of 4 checks passed
simuleite pushed a commit to simuleite/abcoder that referenced this pull request Feb 28, 2026
* feat:support monorepo(output separate and combined)

* feat:add cli options monorepo mode

* feat:add fallback logic

* feat:delete the monorepo yarn detect(due to impact the signle repository)

* feat:add monorepo separate repository output file ignore

* feat:optimize monorepo parse code into function

* feat:optimize monorepo parse separately in cluster workers

* feat:add the ut for monorepo

* feat:optimize the large monorepo parse(dynamically select parsing strategy)

* feat:support edenx workspaces mode

* feat:fill the readme

* fix:cluster mode graph building - Add UNKNOWN node creation for missing dependencies

* feat: modify the ut

* fix:fix the ut

---------

Co-authored-by: yewanting <yewanting@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants